/*
 * @Author: szx
 * @Date: 2022-03-16 14:23:23
 * @LastEditTime: 2022-03-16 14:37:16
 * @Description:
 * @FilePath: \leetcode\300-399\300\300_2.js
 */
/**
 * @param {number[]} nums
 * @return {number}
 */
var lengthOfLIS = function (nums) {
    let min = nums[0];
    let res = 1;
    let len = 1;
    for (let i = 1; i < nums.length; i++) {
        if (min > nums[i]) {
            min = nums[i];
            res = Math.max(res, len);
            len = 1;
        }
        if (nums[i] > nums[i - 1]) len++;
    }
    res = Math.max(res, len);
    return res;
};
console.log(lengthOfLIS([10, 9, 2, 5, 3, 7, 101, 18]));
console.log(lengthOfLIS([0, 1, 0, 3, 2, 3]));
console.log(lengthOfLIS([7, 7, 7, 7, 7, 7, 7]));
console.log(lengthOfLIS([1, 3, 6, 7, 9, 4, 10, 5, 6]));
